<!-- Main menu -->
<!-- This is the structure of main menu -->
<?php
	$page_name = action(1);
    $action = $helper->fast("action");
?>
<ul id="main-menu" class="radius-top clearfix">
    <li>
        <a href="<?=_URL_?>/admin/dashboard" <?php if ( $page_name == 'index' ) echo 'class="active"'; ?>>
            <img src="<?=themes("admin/")?>img/m-dashboard.png" alt="Dashboard" />
            <span>Dashboard</span>
        </a>
    </li>
    <li>
        <!-- Make sure to require the class submenu-active if you are planning to have a submenu with this category/link -->
        <a href="<?=_URL_?>/admin/regional" <?php if ( $page_name == 'regional' ) echo 'class="active submenu-active"'; ?>>
            <img src="<?=themes("admin/")?>img/m-statistics.png" alt="Users" />
            <span>Regional</span>
            <span class="submenu-arrow"></span><!-- Also this is required for the submenu -->
        </a>
    </li>

    <li>
        <!-- Make sure to require the class submenu-active if you are planning to have a submenu with this category/link -->
        <a href="<?=_URL_?>/admin/category" <?php if ( $page_name == 'category' ) echo 'class="active submenu-active"'; ?>>
            <img src="<?=themes("admin/")?>img/m-files.png" alt="Users" />
            <span>Category</span>
            <span class="submenu-arrow"></span><!-- Also this is required for the submenu -->
        </a>
    </li>


    <li>
        <!-- Make sure to require the class submenu-active if you are planning to have a submenu with this category/link -->
        <a href="<?=_URL_?>/admin/directory" <?php if ( $page_name == 'directory' ) echo 'class="active submenu-active"'; ?>>
            <img src="<?=themes("admin/")?>img/m-custom.png" alt="Directory" />
            <span>Directory</span>
            <span class="submenu-arrow"></span><!-- Also this is required for the submenu -->
        </a>
    </li>

    <!--
    <li>
        <a href="<?=_URL_?>/admin/plan" <?php if ( $page_name == 'plan' ) echo 'class="active"'; ?>>
            <img src="<?=themes("admin/")?>img/m-articles.png" alt="Articles" />
            <span>Plans & Location</span>
        </a>
    </li>
    <li>
        <a href="<?=_URL_?>/admin/admin" <?php if ( $page_name == 'admin' ) echo 'class="active"'; ?>>
            <?=global_img("artist.png", "alt='Artist'");?>
            <span>Admin</span>
        </a>
    </li>
    <li>
        <a href="<?=_URL_?>/admin/monitors" <?php if ( $page_name == 'monitors' ) echo 'class="active"'; ?>>
            <?=global_img("music.png", "alt='Monitor'");?>
            <span>XXX</span>
        </a>
    </li>
    <li>
        <a href="<?=_URL_?>/admin/locations/" <?php if ( $page_name == 'queue' ) echo 'class="active"'; ?>>
            <img src="<?=themes("admin/")?>img/queue.png" alt="queue" />
            <span>Todo</span>
        </a>
    </li>
    <li>
        <a href="#" <?php if ( $page_name == 'statistics' ) echo 'class="active"'; ?>>
            <img src="<?=themes("admin/")?>img/m-statistics.png" alt="Statistics" />
            <span>Statistics</span>
        </a>
    </li>
    <li>
        <a href="#" <?php if ( $page_name == 'settings' ) echo 'class="active"'; ?>>
            <img src="<?=themes("admin/")?>img/m-settings.png" alt="Settings" />
            <span>Settings</span>
        </a>
    </li>
    <li>
        <a href="<?=_URL_?>/admin/plugins" <?php if ( $page_name == 'modules' ) echo 'class="active submenu-active"'; ?>>
           	<?=global_img("setting.gif");?>
            <span>Plugins</span>
            <span class="submenu-arrow"></span>
        </a>
    </li>
    -->
</ul>
<!-- END Main menu -->

<!-- Submenu -->
<!-- Depending on the page we are, we make visible the submenu we need -->
<?php
if ( $page_name == 'users' || $page_name == 'monitors' ) {
    $subpage_name ="add_user";

    ?>
<ul id="sub-menu" class="clearfix">
    <li><a href="<?=_URL_?>/admin/users/" <?php if ( $action == "" ) echo 'class="active"'; ?> >Manage Users</a></li>
    <li><a href="<?=_URL_?>/admin/users/?action=addnewuser" <?php if ( $action == 'addnewuser' ) echo 'class="active"'; ?> >Add User</a></li>
    <li><a href="<?=_URL_?>/admin/monitors/?action=listing" <?php if ( $action == "listing" ) echo 'class="active"'; ?> >Monitors Management</a></li>
</ul>
<?php

 } else if ( $page_name == 'plan' || $page_name == 'locations' ) {

?>
<ul id="sub-menu" class="clearfix">
    <li><a href="<?=_URL_?>/admin/plan/" <?php if ( $action == "" ) echo 'class="active"'; ?> >Plans Management</a></li>
    <li><a href="<?=_URL_?>/admin/plan/?action=addnewplan" <?php if ( $action == 'addnewplan' ) echo 'class="active"'; ?> >Add New Plan</a></li>
    <li><a href="<?=_URL_?>/admin/locations/" <?php if ( $action == "" ) echo 'class="active"'; ?> >Locations Management</a></li>
    <li><a href="<?=_URL_?>/admin/locations/?action=addnewlocation" <?php if ( $action == 'addnewlocation' ) echo 'class="active"'; ?> >Add New Location</a></li>
</ul>
<?php
} else if ( $page_name == 'admin' ) {

?>
<ul id="sub-menu" class="clearfix">
    <li><a href="<?=_URL_?>/admin/admin/?action=listing" <?php if ( $action == "listing" ) echo 'class="active"'; ?> >Admin Management</a></li>
    <li><a href="<?=_URL_?>/admin/admin/?action=addnewadmin" <?php if ( $action == 'addnewadmin' ) echo 'class="active"'; ?> >Add New Admin</a></li>
    <li><a href="<?=_URL_?>/admin/admin/?action=listinggroup" <?php if ( $action == "listinggroup" ) echo 'class="active"'; ?> >Group Admin Management</a></li>
    <li><a href="<?=_URL_?>/admin/admin/?action=addnewgroup" <?php if ( $action == 'addnewgroup' ) echo 'class="active"'; ?> >Add New Group</a></li>
</ul>
<?php
}
?>
<!-- END Submenu -->